/***************************************************************************
 创建者：华磊
 开始时间：         : 2020.12.13
 copyright            : (C) 深圳市华友高科有限公司
 修改说明：（每次有修改就添加一条，带有 修改人，修改时间，修改描述）

 ***************************************************************************
 *   等待指令属性编辑视窗
*                                                                         *
 ***************************************************************************/
#include "checkbatterydelegate.h"
#include <QDebug>

CheckBatteryDelegate::CheckBatteryDelegate(QWidget *parent):
    QObject(parent)
{
}

void CheckBatteryDelegate::initView()
{
    checkBatteryView->initData();
}


void CheckBatteryDelegate::clearNoteSlot()
{
    checkBatteryView->note.clear();

    qDebug("clear note");
}

void CheckBatteryDelegate::finishEditInstructionSlot()
{
    //组装指令

    checkBatteryView->checkBatteryInstruction = "CHECK_BATTERY ";

    if(checkBatteryView->batteryElectricQuantity.toInt() <= 0 )
    {
        checkBatteryView->checkBatteryInstruction += "0";
    }
    else
    {
        checkBatteryView->checkBatteryInstruction += checkBatteryView->batteryElectricQuantity;
    }
    checkBatteryView->checkBatteryInstruction += ",LBL[";
    checkBatteryView->checkBatteryInstruction += checkBatteryView->batteryLBLIndex;
    checkBatteryView->checkBatteryInstruction += "];//";
    checkBatteryView->checkBatteryInstruction += checkBatteryView->note;
}
